package com.ark.entity;

import com.baomidou.mybatisplus.annotation.*;
import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.io.Serializable;
import java.math.BigDecimal;
import java.time.LocalDateTime;
import java.util.List;

@Data
@Builder
@NoArgsConstructor
@AllArgsConstructor
@Schema(description = "菜品实体类")
@TableName("dish")
public class Dish implements Serializable {
    @Schema(description = "菜品id")
    @TableId(type = IdType.AUTO)
    private Long id;

    //菜品名称
    @Schema(description = "菜品名称")
    private String name;

    //菜品分类id
    @Schema(description = "菜品分类id")
    private Long categoryId;

    //菜品价格
    @Schema(description = "菜品价格")
    private BigDecimal price;

    //图片
    @Schema(description = "图片地址")
    private String image;

    //描述信息
    @Schema(description = "描述信息")
    private String description;

    //0 停售 1 起售
    @Schema(description = "状态 0-停售 1-起售")
    private Integer status;

    @Schema(description = "创建时间")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm")
    @TableField(fill = FieldFill.INSERT)
    private LocalDateTime createTime;

    @Schema(description = "修改时间")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm")
    @TableField(fill = FieldFill.INSERT_UPDATE)
    private LocalDateTime updateTime;

    @Schema(description = "创建人")
    @TableField(fill = FieldFill.INSERT)
    private Long createUser;

    @Schema(description = "修改人")
    @TableField(fill = FieldFill.INSERT_UPDATE)
    private Long updateUser;

    @TableField(exist = false)
    private List<DishFlavor> flavorList;
}
